﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace Interscape.TwilioClient.Components
{
    /// <summary>
    /// The base TwilioClient object that represents information common to all TwilioAPI responses.
    /// </summary>
    [Serializable]
    public abstract class BaseInfo
    {

        /// <summary>
        /// Creates a new instance of the BaseInfo object.
        /// </summary>
        protected BaseInfo()
        {
            this.PostArguments = new SortedList<string, string>();
        }

        /// <summary>
        /// Creates a new instance of the BaseInfo object.
        /// </summary>
        /// <param name="sid">A 34 character string that uniquely identifies this resource.</param>
        protected BaseInfo(string sid) : this()
        {
            this.Sid = sid;
        }

        /// <summary>
        /// A 34 character string that uniquely identifies this resource.
        /// </summary>
        [XmlElement]
        public string Sid { get; set; }

        /// <summary>
        /// The date that this resource was created, given in RFC 2822 format. 
        /// </summary>
        [XmlElement("DateCreated")]
        public string ServiceDateCreated { get; set; }

        /// <summary>
        /// The date that this resource was last updated, given in RFC 2822 format. 
        /// </summary>
        [XmlElement("DateUpdated")]
        public string ServiceDateUpdated { get; set; }

        /// <summary>
        /// A SortedList (or collection of generic KeyValuePair objects) to hold extra parameters to pass to the TwilioAPI.
        /// </summary>
        [XmlIgnore]
        public SortedList<string, string> PostArguments { get; set; }

    }
}
